$import('com.hh.system.data.DataListTree');
Ext
		.define(
				'com.hh.workflow.designer.WorkFlowListTree',
				{
					extend : 'com.hh.system.data.DataListTree',
					title : '工作流列表',
					extraParams : {
						type : 'workflow_tree'
					},
					delete_action : 'workflow-WorkFlowInfo-deleteByIds',
					constructor : function(config) {
						this.config = config || {};
						this.superclass.constructor.call(this, this.config);
						var panel = this;
						this.addToolbarItems();
						this.init();
					},
					addToolbarItems : function() {
						var panel = this;
						this.toolbarItems = [ {
							icon : 'struts-image?path=com/hh/workflow/img/application_lightning.png',
							text : '部署',
							handler : function() {
								panel.doDeploy();
							}
						} ];
					},
					doDeploy : function() {
						var page = this;
//						var record = this.tree.getSelectionModel()
//								.getSelection();
						var record =	page.tree.getSelectionModel().lastFocused;
						if (Util.isNull(record)) {
							ExtFrame.info('请选中要部署的流程！');
						} else {
							if (!Util.isNull(record)) {
								Request.synRequestObject(
										'workflow-Activiti-deploy', {
											dataId : record.get("id")
										});
							} else {
								ExtFrame.info('请选中要部署的流程！');
							}
						}
					}
				});